/*
Copyright (C) 2010  Christoph Schnack, Berlin (Germany)

This file is part of Tribuit.

    Tribuit is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Tribuit is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Tribuit.  If not, see <http://www.gnu.org/licenses/>.
*/
package Storage;

/**
 * 
 * @author Christoph Schnack
 *
 */
public class Term {
	String article, term, category;
	
	/**
	 * 
	 * @param art article
	 * @param ter term
	 * @param cat category
	 */
	public Term(String art, String ter, String cat){
		article = art;
		term = ter;
		category = cat;
	}
	
	public String getTerm(){
		return term;
	}
	public void setTerm(String s){
		if(s==null && !term.equals(""))term=s;
	}
	
	public String getTermWithArticleUnformatted(){
		return (hasArticle()?article+" ":"")+term;
	}
	
	public void setArticle(String s){
		article = (s==null)?"":s;
	}
	public String getArticle(){
		return article;
	}
	public boolean hasArticle(){
		return (article!=null && !article.equals("") && !article.equals("~"));
	}
	
	public String getCategory(){
		return category;
	}
	
	public void setCategory(String s){
		if(s!=null)category = s;
	}
	
	public boolean hasCategory(){
		return (category!=null && !category.equals("") && !category.equals("~") && !category.equals("n.a."));
	}
	
	public String getFullTerm(){
		return (article==null)?term:(article+" "+term);
	}
}
